import { defHttp } from "@/utils/http";

// ERP 资产转移 VO
export interface AssetTransferInfoVO {
	id: number; // 主键
	startDept: string; // 从部门ID
	endDept: string; // 到部门ID
	description: string; // 描述
	img: string; // 图片
	sqNumb: number; // 序号,用于资产排序
}

// ERP 资产转移 API
export const AssetTransferInfoApi = {
	// 查询资产转移分页
	getAssetTransferInfoPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asm-tranfers/page`, params });
	},

	// 查询资产转移详情
	getAssetTransferInfo: async (id: number) => {
		return await defHttp.get({ url: `/whs/asm-tranfers/get?id=` + id });
	},

	// 新增资产转移
	createAssetTransferInfo: async (data: AssetTransferInfoVO) => {
		return await defHttp.post({ url: `/whs/asm-tranfers/create`, data });
	},

	// 修改资产转移
	updateAssetTransferInfo: async (data: AssetTransferInfoVO) => {
		return await defHttp.put({ url: `/whs/asm-tranfers/update`, data });
	},

	// 删除资产转移
	deleteAssetTransferInfo: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asm-tranfers/delete?id=` + id
		});
	},

	// 导出资产转移 Excel
	exportAssetTransferInfo: async (params: any) => {
		return await defHttp.download({ url: `/whs/asm-tranfers/export-excel`, params });
	}
};
